Global Lighting Default Hq Nvdbt
(global_lighting:default:HQ:NVDBT
, 0x76c5baf5189ee557
)
This template is referenced 1 time by global_lighting:HQ.
Technique ambient
Render States
More info can be found on the Direct3D Docs
enum D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 0,
D3DRS_ZFUNC = 4,
D3DRS_ZWRITEENABLE = 0,
D3DRS_ALPHABLENDENABLE = 0,
D3DRS_CULLMODE = 1,
D3DRS_COLORWRITEENABLE = 15,
D3DRS_COLORWRITEENABLE1 = 15,
D3DRS_COLORWRITEENABLE2 = 15,
D3DRS_STENCILENABLE = 1,
D3DRS_STENCILFUNC = 6,
D3DRS_STENCILFAIL = 1,
D3DRS_STENCILMASK = -1,
D3DRS_STENCILPASS = 1,
D3DRS_STENCILREF = 5,
D3DRS_STENCILWRITEMASK = 255,
D3DRS_STENCILZFAIL = 1,
D3DRS_DEPTHBIAS = 0,
D3DRS_SLOPESCALEDEPTHBIAS = 0,
D3DRS_FOGENABLE = 0,
D3DRS_SPECULARENABLE = 0,
D3DRS_ADAPTIVETESS_X = 0,
D3DRS_ADAPTIVETESS_Z = 0,
D3DRS_ADAPTIVETESS_W = 0,
D3DRS_SRGBWRITEENABLE = 0,
D3DRS_SEPARATEALPHABLENDENABLE = 0,
D3DRS_ALPHATESTENABLE = 0,
};
Sampler States
More info can be found on the Direct3D Docs
Sampler 0
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 1
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 2
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 3
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 4
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 5
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 1,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 2,
D3DSAMP_MINFILTER = 2,
D3DSAMP_MIPFILTER = 2,
};
Sampler 6
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 1,
D3DSAMP_ADDRESSU = 1,
D3DSAMP_ADDRESSV = 1,
D3DSAMP_MAGFILTER = 3,
D3DSAMP_MINFILTER = 3,
D3DSAMP_MIPFILTER = 3,
};
Shaders
Vertex Shader
column_major float4x4 camera_inv_view_matrix : register(vs_3_0, c4);
float3 camera_unprojection : register(vs_3_0, c7);
column_major float4x4 view_proj_matrix : register(vs_3_0, c0);
struct VertexMain_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
};
struct VertexMain_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float3 texcoord1 : TEXCOORD1;
};
VertexMain_Output VertexMain(VertexMain_Input i)
{
VertexMain_Output o;
float2 temp0;
float3 temp1;
// def c8, 1, 0, 0, 0
// dcl_position v0
// dcl_texcoord v1
// dcl_position o0
// dcl_texcoord o1.xy
// dcl_texcoord1 o2.xyz
// dp4 o0.z, v0, c2
o.position.z = dot(i.position, (view_proj_matrix._m02_m12_m22_m32));
// dp4 o0.w, v0, c3
o.position.w = dot(i.position, (view_proj_matrix._m03_m13_m23_m33));
// dp4 r0.x, v0, c0
temp0.x = dot(i.position, (view_proj_matrix._m00_m10_m20_m30));
// dp4 r0.y, v0, c1
temp0.y = dot(i.position, (view_proj_matrix._m01_m11_m21_m31));
// mul r1.xy, r0, c7
temp1.xy = temp0.xy * camera_unprojection.xy;
// mov o0.xy, r0
o.position.xy = temp0.xy;
// mov r1.z, c8.x
temp1.z = float1(1);
// dp3 o2.x, r1, c4
o.texcoord1.x = dot(temp1.xyz, (camera_inv_view_matrix._m00_m10_m20_m30).xyz);
// dp3 o2.y, r1, c5
o.texcoord1.y = dot(temp1.xyz, (camera_inv_view_matrix._m01_m11_m21_m31).xyz);
// dp3 o2.z, r1, c6
o.texcoord1.z = dot(temp1.xyz, (camera_inv_view_matrix._m02_m12_m22_m32).xyz);
// mov o1.xy, v1
o.texcoord = i.texcoord;
//
return o;
}
Decompiled by DXDecompiler.
Pixel Shader
sampler2D albedo : register(ps_3_0, s0);
column_major float4x4 camera_world_matrix : register(ps_3_0, c0);
sampler2D depth : register(ps_3_0, s2);
sampler2D diffuse_texture : register(ps_3_0, s1);
sampler2D filter_color_texture : register(ps_3_0, s5);
float3 global_light_col : register(ps_3_0, c11);
float3 global_light_dir : register(ps_3_0, c10);
float3 ref_ambient_color : register(ps_3_0, c7);
float ref_ambient_falloff_scale : register(ps_3_0, c6);
float ref_ambient_scale : register(ps_3_0, c5);
float ref_bloom_threshold : register(ps_3_0, c18);
float3 ref_dome_occ_pos : register(ps_3_0, c3);
float3 ref_dome_occ_size : register(ps_3_0, c4);
float3 ref_fog_far_low_color : register(ps_3_0, c13);
float ref_fog_max_density : register(ps_3_0, c16);
float ref_fog_max_range : register(ps_3_0, c15);
float ref_fog_min_range : register(ps_3_0, c14);
float3 ref_fog_start_color : register(ps_3_0, c12);
float3 ref_sky_bottom_color : register(ps_3_0, c9);
float3 ref_sky_top_color : register(ps_3_0, c8);
float ref_use_ssao : register(ps_3_0, c17);
samplerCUBE reflection_texture : register(ps_3_0, s6);
sampler2D self_illumination_texture : register(ps_3_0, s4);
sampler2D temp : register(ps_3_0, s3);
struct PixelMain_Input
{
float2 texcoord : TEXCOORD;
float3 texcoord1 : TEXCOORD1;
};
float4 PixelMain(PixelMain_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2, temp3, temp4, temp7;
float3 temp5, temp6;
// def c19, -0.5, 0.5, 1, 2
// def c20, 0, 590, 10, 4
// def c21, 11.2, 1.68, 0.05, 0.004
// def c22, 1.68, 0.5, 0.06, -0.06666667
// def c23, 0.37, 1.0001, 0, 0
// dcl_texcoord v0.xy
// dcl_texcoord1 v1.xyz
// dcl_2d s0
// dcl_2d s1
// dcl_2d s2
// dcl_2d s3
// dcl_2d s4
// dcl_2d s5
// dcl_cube s6
// texld r0, v0, s2
temp0 = tex2D(depth, i.texcoord.xy);
// texld r1, v0, s3
temp1 = tex2D(temp, i.texcoord.xy);
// add r0.yzw, r1.xxyz, r1.xxyz
temp0.yzw = temp1.xyz + temp1.xyz;
// texld r2, v0, s0
temp2 = tex2D(albedo, i.texcoord.xy);
// texld r3, v0, s1
temp3 = tex2D(diffuse_texture, i.texcoord.xy);
// add_pp r1.xyz, r3, c19.x
temp1.xyz = /* not implemented _pp modifier */ temp3.xyz + float3(-0.5, -0.5, -0.5);
// add_pp r3.xyz, r1.zxyw, r1.zxyw
temp3.xyz = /* not implemented _pp modifier */ temp1.zxy + temp1.zxy;
// mov r4.x, c0.w
temp4.x = (camera_world_matrix._m00_m10_m20_m30).w;
// mov r4.y, c1.w
temp4.y = (camera_world_matrix._m01_m11_m21_m31).w;
// mov r4.z, c2.w
temp4.z = (camera_world_matrix._m02_m12_m22_m32).w;
// mad r5.xyz, v1, r0.x, r4
temp5.xyz = i.texcoord1.xyz * temp0.xxx + temp4.xyz;
// add r4.xyz, r4, -r5
temp4.xyz = temp4.xyz + -temp5.xyz;
// dp3 r1.x, r4, r4
temp1.x = dot(temp4.xyz, temp4.xyz);
// rsq r1.x, r1.x
temp1.x = 1 / sqrt(temp1.x);
// mul r6.xyz, r1.x, r4
temp6.xyz = temp1.xxx * temp4.xyz;
// add r5.xyz, r5, -c3
temp5.xyz = temp5.xyz + -ref_dome_occ_pos.xyz;
// rcp r7.x, c4.x
temp7.x = 1.0f / ref_dome_occ_size.x;
// rcp r7.y, c4.y
temp7.y = 1.0f / ref_dome_occ_size.y;
// rcp r1.y, c4.z
temp1.y = 1.0f / ref_dome_occ_size.z;
// mul r5.xy, r5, r7
temp5.xy = temp5.xy * temp7.xy;
// texld r7, r5, s5
temp7 = tex2D(filter_color_texture, temp5.xy);
// add r4.w, r7.y, r7.x
temp4.w = temp7.y + temp7.x;
// mul r4.w, r4.w, c19.y
temp4.w = temp4.w * float1(0.5);
// mad r4.w, r4.w, -r4.w, c19.z
temp4.w = temp4.w * -temp4.w + float1(1);
// mad_sat r1.y, r5.z, -r1.y, r4.w
temp1.y = saturate(temp5.z * -temp1.y + temp4.w);
// add r1.y, -r1.y, c19.z
temp1.y = -temp1.y + float1(1);
// add r1.y, r1.y, -c5.x
temp1.y = temp1.y + -ref_ambient_scale.x;
// mov r5.z, c19.z
temp5.z = float1(1);
// add r4.w, r5.z, -c5.x
temp4.w = temp5.z + -ref_ambient_scale.x;
// rcp r4.w, r4.w
temp4.w = 1.0f / temp4.w;
// mul_sat r1.y, r1.y, r4.w
temp1.y = saturate(temp1.y * temp4.w);
// mad r1.z, r1.z, c19.w, c19.z
temp1.z = temp1.z * float1(2) + float1(1);
// mul r4.w, r1.z, c19.y
temp4.w = temp1.z * float1(0.5);
// mad r1.z, r1.z, -c19.y, c19.z
temp1.z = temp1.z * float1(-0.5) + float1(1);
// mul r5.xyz, r1.z, c9
temp5.xyz = temp1.zzz * ref_sky_bottom_color.xyz;
// mul r1.z, r1.y, r1.y
temp1.z = temp1.y * temp1.y;
// mad r5.xyz, r1.z, r5, c7
temp5.xyz = temp1.zzz * temp5.xyz + ref_ambient_color.xyz;
// mul r7.xyz, r4.w, c8
temp7.xyz = temp4.www * ref_sky_top_color.xyz;
// mad r5.xyz, r7, r1.y, r5
temp5.xyz = temp7.xyz * temp1.yyy + temp5.xyz;
// mov r7.x, c20.x
temp7.x = float1(0);
// if_lt -c17.x, r7.x
if (-ref_use_ssao.x < temp7.x) {
// texld r7, v0, s4
temp7 = tex2D(self_illumination_texture, i.texcoord.xy);
// mul r5.xyz, r5, r7.x
temp5.xyz = temp5.xyz * temp7.xxx;
// endif
}
// dp3_sat r1.z, -c10.zxyw, r3
temp1.z = saturate(dot(-global_light_dir.zxy, temp3.xyz));
// mul r1.z, r1.w, r1.z
temp1.z = temp1.w * temp1.z;
// mad r4.xyz, r4, r1.x, -c10
temp4.xyz = temp4.xyz * temp1.xxx + -global_light_dir.xyz;
// nrm r7.xyz, r4
temp7.xyz = normalize(temp4.xyz).xyz;
// mad r1.x, r2.w, c20.y, c20.z
temp1.x = temp2.w * float1(590) + float1(10);
// mul r1.w, r3.w, r3.w
temp1.w = temp3.w * temp3.w;
// mul r1.w, r1.z, r1.w
temp1.w = temp1.z * temp1.w;
// mul r1.w, r1.w, c20.w
temp1.w = temp1.w * float1(4);
// mul r4.xyz, r1.w, c11
temp4.xyz = temp1.www * global_light_col.xyz;
// dp3_sat r1.w, r7.zxyw, r3
temp1.w = saturate(dot(temp7.zxy, temp3.xyz));
// pow r2.w, r1.w, r1.x
temp2.w = pow(temp1.w, temp1.x);
// mad r1.xzw, c11.xyyz, r1.z, r5.xyyz
temp1.xzw = global_light_col.xyz * temp1.zzz + temp5.xyz;
// mad r0.yzw, r2.xxyz, r1.xxzw, r0
temp0.yzw = temp2.xyz * temp1.xzw + temp0.yzw;
// mad r0.yzw, r4.xxyz, r2.w, r0
temp0.yzw = temp4.xyz * temp2.www + temp0.yzw;
// mad r1.x, r3.w, -r3.w, c19.z
temp1.x = temp3.w * -temp3.w + float1(1);
// mul r2.w, r1.x, c20.w
temp2.w = temp1.x * float1(4);
// dp3 r1.x, r6.zxyw, r3
temp1.x = dot(temp6.zxy, temp3.xyz);
// add r1.x, r1.x, r1.x
temp1.x = temp1.x + temp1.x;
// mad r2.xyz, r3.yzxw, -r1.x, r6
temp2.xyz = temp3.yzx * -temp1.xxx + temp6.xyz;
// texldl r2, r2, s6
temp2 = texCUBElod(reflection_texture, temp2);
// mul r1.x, r3.w, c6.x
temp1.x = temp3.w * ref_ambient_falloff_scale.x;
// mov_sat r3.x, r3.x
temp3.x = saturate(temp3.x);
// mul r1.x, r1.x, r3.x
temp1.x = temp1.x * temp3.x;
// mul r1.x, r1.y, r1.x
temp1.x = temp1.y * temp1.x;
// mad r0.yzw, r2.xxyz, r1.x, r0
temp0.yzw = temp2.xyz * temp1.xxx + temp0.yzw;
// add r0.x, r0.x, -c14.x
temp0.x = temp0.x + -ref_fog_min_range.x;
// rcp r1.x, c15.x
temp1.x = 1.0f / ref_fog_max_range.x;
// mul r0.x, r0.x, r1.x
temp0.x = temp0.x * temp1.x;
// max r1.x, r0.x, c20.x
temp1.x = max(temp0.x, float1(0));
// min r0.x, c16.x, r1.x
temp0.x = min(ref_fog_max_density.x, temp1.x);
// add r0.x, -r0.x, c19.z
temp0.x = -temp0.x + float1(1);
// mul r0.x, r0.x, r0.x
temp0.x = temp0.x * temp0.x;
// mul r0.x, r0.x, r0.x
temp0.x = temp0.x * temp0.x;
// mul r1.xyz, r0.yzww, c21.x
temp1.xyz = temp0.yzw * float3(11.2, 11.2, 11.2);
// mad r2.xyz, r0.yzww, c21.y, c21.z
temp2.xyz = temp0.yzw * float3(1.68, 1.68, 1.68) + float3(0.05, 0.05, 0.05);
// mad r2.xyz, r1, r2, c21.w
temp2.xyz = temp1.xyz * temp2.xyz + float3(0.004, 0.004, 0.004);
// mad r0.yzw, r0, c22.x, c22.y
temp0.yzw = temp0.yzw * float3(1.68, 1.68, 1.68) + float3(0.5, 0.5, 0.5);
// mad r0.yzw, r1.xxyz, r0, c22.z
temp0.yzw = temp1.xyz * temp0.yzw + float3(0.06, 0.06, 0.06);
// rcp r1.x, r0.y
temp1.x = 1.0f / temp0.y;
// rcp r1.y, r0.z
temp1.y = 1.0f / temp0.z;
// rcp r1.z, r0.w
temp1.z = 1.0f / temp0.w;
// mad r0.yzw, r2.xxyz, r1.xxyz, c22.w
temp0.yzw = temp2.xyz * temp1.xyz + float3(-0.06666667, -0.06666667, -0.06666667);
// dp3 r1.x, r0.yzww, c23.x
temp1.x = dot(temp0.yzw, float3(0.37, 0.37, 0.37));
// add_sat r1.x, r1.x, -c18.x
temp1.x = saturate(temp1.x + -ref_bloom_threshold.x);
// mov r1.y, c23.y
temp1.y = float1(1.0001);
// add r1.y, r1.y, -c18.x
temp1.y = temp1.y + -ref_bloom_threshold.x;
// rcp r1.y, r1.y
temp1.y = 1.0f / temp1.y;
// mul r1.x, r1.y, r1.x
temp1.x = temp1.y * temp1.x;
// mul r1.y, r1.x, r1.x
temp1.y = temp1.x * temp1.x;
// mul r1.x, r1.y, r1.x
temp1.x = temp1.y * temp1.x;
// mul oC0.w, r0.x, r1.x
out_color.w = temp0.x * temp1.x;
// mov r1.xyz, c13
temp1.xyz = ref_fog_far_low_color.xyz;
// add r1.xyz, -r1, c12
temp1.xyz = -temp1.xyz + ref_fog_start_color.xyz;
// mad r1.xyz, r0.x, r1, c13
temp1.xyz = temp0.xxx * temp1.xyz + ref_fog_far_low_color.xyz;
// add r0.yzw, r0, -r1.xxyz
temp0.yzw = temp0.yzw + -temp1.xyz;
// mad oC0.xyz, r0.x, r0.yzww, r1
out_color.xyz = temp0.xxx * temp0.yzw + temp1.xyz;
//
return out_color;
}
Decompiled by DXDecompiler.